<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: zhanghz001
  Date: 2020/11/3
  Time: 15:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>学生列表</title>
</head>
<body>
<table border="1" cellpadding="0" cellspacing="0" align="center" width="450">
    <caption>学生列表</caption>
    <thead>
    <tr>
        <th>学生姓名</th>
        <th>学生分数</th>
        <th>学生年龄</th>
    </tr>
    </thead>
    <tbody align="center">
    <%--    <%--%>
    <%--        ArrayList<Student> list = (ArrayList<Student>) request.getAttribute("list");--%>
    <%--        for (Student student : list) {--%>
    <%--            int age = student.getAge();--%>
    <%--            String username = student.getUsername();--%>
    <%--            int score = student.getScore();--%>
    <%--            out.println("<tr>");--%>

    <%--            out.println("<td>");--%>
    <%--            out.println(username);--%>
    <%--            out.println("</td>");--%>

    <%--            out.println("<td>");--%>
    <%--            out.println(score);--%>
    <%--            out.println("</td>");--%>

    <%--            out.println("<td>");--%>
    <%--            out.println(age);--%>
    <%--            out.println("</td>");--%>

    <%--            out.println("</tr>");--%>
    <%--        }--%>
    <%--    %>--%>
    <hr>
    <c:forEach items="${requestScope.list}" var="s">

        <tr>
            <td>${s.username}</td>
            <td>${s.score}</td>
            <td>${s.age}</td>
        </tr>
    </c:forEach>
    </tbody>
</table>

</body>
</html>
